﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CentralMonitoring
{
    public partial class DeviceControl : UserControl
    {
        public DeviceControl()
        {
            InitializeComponent();           
        }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string mParaDvName
        { 
            get { return groupBoxDv.Text; }
            set { groupBoxDv.Text = value;}
        }
        
        /// <summary>
        /// 设备位置
        /// </summary>
        public Label mParaDvSite
        {
            get { return labelSite; }
        }
        /// <summary>
        /// 设备油品
        /// </summary>
        public Label mParaDvOil
        {
            get { return labelOil; }
        }
        public Label mParaDvSensor
        {
            get { return labelSensor; }
        }
        public Label mParaDvTime
        {
            get { return labelTime; }
        }
        /// <summary>
        /// 状态指示灯
        /// </summary>
        public UserButton StatusLight
        {
            get { return _statusLight; }
        }
        public Button mParaView
        {
            get { return btnView; }
        }
        public void  SetLight(int level)
        {
            switch(level)
            {
                case 0: _statusLight.BackgroundImage = global::CentralMonitoring.Properties.Resources.LightS;break;
                case 1: _statusLight.BackgroundImage = global::CentralMonitoring.Properties.Resources.LightG;break;              
                default: _statusLight.BackgroundImage = global::CentralMonitoring.Properties.Resources.LightS; break;
            }               
          
        }      

    }
}
